<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
  <g:set var="entityName" value="${message(code: 'task.label', default: 'Task')}" />
  <title><g:message code="default.list.label" args="[entityName]" /></title>
</head>
<body>
  <div class="nav">
    <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
    <g:ifAllGranted role="ROLE_ADMIN">
    <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
    </g:ifAllGranted>
  </div>
  <div class="body">
    <h1><g:message code="default.list.label" args="[entityName]" /></h1>
    <g:form action="list">
      <div class="dialog">
        <table>
          <tbody>

            <tr class="prop">
              <td valign="top" class="name">Enter Keyword :</td>
              <td valign="top">
                <input type="text" id="username" name="search_key" value=""/>
              </td>
            </tr>
          </tbody>
        </table>
      </div>

      <div class="buttons">
        <span class="button"><input class="save" type="submit" value="Search" /></span>
      </div>
    </g:form>
    <br />
    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>
    <div class="list">
      <table>
        <thead>
          <tr>

        <g:sortableColumn property="id" title="${message(code: 'task.id.label', default: 'Id')}" />

        <g:sortableColumn property="project" title="${message(code: 'task.project.label', default: 'Project')}" />
        
        <g:sortableColumn property="name" title="${message(code: 'task.name.label', default: 'Name')}" />

        <g:sortableColumn property="description" title="${message(code: 'task.description.label', default: 'Description')}" />

        <g:sortableColumn property="endPlanDate" title="${message(code: 'task.endPlanDate.label', default: 'End Plan Date')}" />

        <g:sortableColumn property="endDate" title="${message(code: 'task.endDate.label', default: 'End Date')}" />


        </tr>
        </thead>
        <tbody>
        <g:each in="${taskInstanceList}" status="i" var="taskInstance">
          <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">

          <td><g:link action="show" id="${taskInstance.id}">${fieldValue(bean: taskInstance, field: "id")}</g:link></td>

          <td>${fieldValue(bean: taskInstance, field: "project.name")}</td>

          <td>${fieldValue(bean: taskInstance, field: "name")}</td>

          <td>${fieldValue(bean: taskInstance, field: "description")}</td>

          <td><g:formatDate date="${taskInstance.endPlanDate}" /></td>

          <td><g:formatDate date="${taskInstance.endDate}" /></td>


          </tr>
        </g:each>
        </tbody>
      </table>
    </div>
    <div class="paginateButtons">
      <g:paginate total="${taskInstanceTotal}" />
    </div>
  </div>
</body>
</html>
